home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-09-20 | 50.5 KB | 1,756 lines |
- Newsgroups: comp.sources.misc
- From: uunet!sawmill!prslnk!buhrt (Jeff Buhrt)
- Subject: REPOST: v22i095: sc - The SC Spreadsheet, release 6.16, Patch01a/2
- Message-ID: <1991Sep20.143324.5998@sparky.imd.sterling.com>
- X-Md4-Signature: ae2e70f73bf50230d7bdc8ef7b6e8940
- Date: Fri, 20 Sep 1991 14:33:24 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: uunet!sawmill!prslnk!buhrt (Jeff Buhrt)
- Posting-number: Volume 22, Issue 95
- Archive-name: sc/patch01a
- Environment: UNIX, VMS, MS-DOS
- Patch-To: sc: Volume 20, Issue 35-41
-
- [ This is being reposted due to a propagation error. ]
-
- This is the first part of a two part SHAR archive that must be
- extracted before applying pch616-617 to Sc6.16. The new revision
- level will be: 6.17.
-
- To see what this changes see CHANGES down about 30 lines. There
- There were no major bugs, just a few small fixes, new features,
- and new hardware/OS platforms.
-
- -Jeff Buhrt
- {sequent,uunet}!sawmill!prslnk!buhrt
- 812-275-0750 work
- Proslink, Inc.
- ----
- #!/bin/sh
- # This is a shell archive (produced by shar 3.49)
- # To extract the files from this archive, save it to a file, remove
- # everything above the "!/bin/sh" line above, and type "sh file_name".
- #
- # This is part 1 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- #
- # This shar contains:
- # length mode name
- # ------ ---------- ------------------------------------------
- # 72450 -rw-rw-rw- pch616-617
- # 189 -r--r--r-- torev
- #
- if test -r _shar_seq_.tmp; then
- echo 'Must unpack archives in sequence!'
- echo Please unpack part `cat _shar_seq_.tmp` next
- exit 1
- fi
- # ============= pch616-617 ==============
- if test -f 'pch616-617' -a X"$1" != X"-c"; then
- echo 'x - skipping pch616-617 (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting pch616-617 (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'pch616-617' &&
- *** 6.16 1991/06/04 18:55:36
- --- CHANGES 1991/09/04 14:27:59
- ***************
- *** 1,3 ****
- --- 1,48 ----
- + CHANGES BETWEEN 6.17 and 6.16
- + Ulf Noren
- + - added cell locking, disallowing input, to ranges of cells
- + Herr Soeryantono
- + - I added ifdef's around curses KEY_* functions his curses didn't have
- + (Sun/OS 4 on a SPARC)
- + Jay Lepreau
- + - changes to tutorial.sc: how to get out, should be used w/ 24 lines
- + - IDLOKBAD was not passed to screen.c
- + - suggested error messages if the execl of crypt fails
- + - pointed out BSD's crypt is in /usr/bin/crypt
- + Henk P. Penning
- + - suggested Makefile list the mode of the man page & tutorial.sc
- + - make install will now install the psc man
- + - yylval was not known in lex.c for HP-UX 7.05
- + Edgard
- + - hitwinch fixes
- + - KEY_HOME now takes you to 0,0
- + CHECK KEY_NPAGE/PPAGE
- + Stephen (Steve) M. Brooks
- + - suggested the man pages should include Sc's revision
- + Dan Banay
- + - code to set LINES and COLS after a window size change
- + Bart Schaefer
- + - @myrow/@mycol fix
- + Bruce Jerrick
- + - noted ln may not always work for the temporary source files
- + Gene H. Olson
- + - fixes for SIGWINCH for Sun OS 4.1.1
- + Teus Hagen
- + - added three functions:
- + 1) allow @PI as well
- + 2) @upper/@lower for casing characters in a string
- + 3) @capital for upper case first char of words in a string.
- + Martin Maclaren
- + - added MS-DOS support
- + COMPILER USED: Microsoft C, 5.1
- + TOOLS USED : NDMAKE GNUBISON GNUSED PCCURSES
- + Cuong Bui
- + - has a working Vietnamese version of sc, noted a A_CHARTEXT
- + mask problem
- + Jeff Buhrt
- + - when numeric prescale is on: 300 -> 3.0, now 300. -> 300. not 3.0
- + (numbers with a decimal aren't scaled)
- +
- X CHANGES BETWEEN 6.16 and 6.15
- X Tom Tkacik
- X -fixed a bug in ^W
- *** 6.16 1991/06/04 18:57:22
- --- README 1991/09/04 14:27:58
- ***************
- *** 1,8 ****
- X This is a much modified version of the public domain spread sheet sc,
- X posted several years ago by Mark Weiser as vc, originally by James Gosling.
- X
- ! CHANGES lists the changes since 6.1 to 6.15.
- ! Current maintainer: {sequent, tippy.cs.purdue.edu}!sawmill!buhrt (Jeff Buhrt)
- X
- X When you get it built, try "sc tutorial.sc" for a simple introduction
- X to the basic commands.
- --- 1,8 ----
- X This is a much modified version of the public domain spread sheet sc,
- X posted several years ago by Mark Weiser as vc, originally by James Gosling.
- X
- ! CHANGES lists the changes since 6.1 to 6.17.
- ! Current maintainer: {sequent, uunet}!sawmill!prslnk!buhrt (Jeff Buhrt)
- X
- X When you get it built, try "sc tutorial.sc" for a simple introduction
- X to the basic commands.
- ***************
- *** 13,19 ****
- X If you have the command 'file' that uses /etc/magic add the line:
- X 38 string Spreadsheet sc file
- X
- ! Psc formats ascii files for use in the spread sheet. If you don't have
- X getopts, there is a public domain version by Henry Spencer hidden away in
- X the VMS_NOTES file.
- X
- --- 13,19 ----
- X If you have the command 'file' that uses /etc/magic add the line:
- X 38 string Spreadsheet sc file
- X
- ! Psc formats ascii files for use in the spreadsheet. If you don't have
- X getopts, there is a public domain version by Henry Spencer hidden away in
- X the VMS_NOTES file.
- X
- ***************
- *** 36,69 ****
- X makefile). SIMPLE causes the arrow keys to not be used.
- X
- X If you have problems with your yacc saying: too many terminals ...127...
- ! Comment out the gram.c and y.tab.c code in Makefile and uncomment the
- ! section that uses mygram.c and myy.tab.h.
- X
- X Guidelines for Hackers:
- X
- X If you want to send changes you have made to SC, please feel free to do
- ! so. If they work :-) and seem worthwhile, I'll put them in. Please
- ! refrain from wholesale "style" or "cleanup" changes. It is easy to add
- ! your changes but it makes it hard to merge in the next guy's stuff if
- ! he used the release as a base. Leave my $Revision: identifiers alone-
- ! they help me track what you used as a base. If you check the code into
- ! rcs, delete the "$"s on the Revison lines before you do.
- !
- ! You may not like 4 space indenting and curly braces on the "if" line, but
- ! your code will look like that before it leaves my hands so you may as well
- ! abide by the style in the code when you make your changes. I have also been
- ! known to break things trying to make them look "right". If you do string
- ! functions, please, PLEASE pay attention to null pointers, use xmalloc,
- ! xrealloc, and xfree; and xfree those arguments. And don't forget to
- ! document your changes in both help.c and sc.doc.
- X
- X Disclaimer:
- X
- X Starting 4/4/90: (I will be maintaining Sc for a while at least,
- X Robert Bond has been very busy lately)
- - Sc is not a product of Grauel Enterprises, Inc. It is supplied as
- - is with no warranty, express or implied, as a service to Usenet readers.
- - It is not copyrighted, either. Have at it.
- X
- X Archives:
- X 1) (FTP) jpd@usl.edu James Dugal
- --- 36,71 ----
- X makefile). SIMPLE causes the arrow keys to not be used.
- X
- X If you have problems with your yacc saying: too many terminals ...127...
- ! Find a different yacc: bison, Berkeley yacc, Pd yacc, etc. AT&T's Sys V
- ! yacc has small, fixed sized tables. SCO will allow dynamic yacc tables
- ! when given the correct flags.
- X
- X Guidelines for Hackers:
- X
- X If you want to send changes you have made to SC, please feel free to do
- ! so. If they work :-) and seem worthwhile, I'll put them in.
- X
- + a) Please refrain from wholesale "style" or "cleanup" changes. It is easy
- + to add your changes but it makes it hard to merge in the next guy's
- + stuff if he used the release as a base. Suggestions are welcome.
- +
- + b) Leave my $Revision: identifiers alone-they help me track what you used
- + as a base. If you check the code into rcs, delete the "$"s on the
- + Revison lines before you do.
- + c) Please abide by the style in the code when you make your changes. It is easy
- + to break things trying to make them look "right".
- + d) If you do string functions, please, PLEASE pay attention to null pointers,
- + use xmalloc, xrealloc, and xfree; and xfree those arguments.
- + e) Please don't forget to document your changes in both help.c and sc.doc.
- + f) WHEN sending diffs: please use diff -c (context diff, and possibly
- + more than three lines on each side), I get a lot of code and
- + things move.
- + g) Please send an explanation of what your code does and how to use/test it.
- +
- X Disclaimer:
- X
- X Starting 4/4/90: (I will be maintaining Sc for a while at least,
- X Robert Bond has been very busy lately)
- X
- X Archives:
- X 1) (FTP) jpd@usl.edu James Dugal
- ***************
- *** 76,82 ****
- X Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
- X (Grab dumbcat!~/INDEX for a complete list)
- X
- X Jeff Buhrt
- ! Grauel Enterprises, Inc.
- ! sequent!sawmill!buhrt
- X
- --- 78,88 ----
- X Note: dumbcat speaks 9600 at V.32 -- sorry, this is not a Telebit modem.
- X (Grab dumbcat!~/INDEX for a complete list)
- X
- + Sc is not a product of ProsLink, Inc. It is supplied as is with no
- + warranty, express or implied, as a service to Usenet readers. It is not
- + copyrighted, either. Have at it.
- +
- X Jeff Buhrt
- ! ProsLink, Inc.
- ! {sequent, uunet}!sawmill!prslnk!buhrt
- X
- *** 6.16 1991/06/04 18:57:22
- --- sc.doc 1991/09/04 14:28:02
- ***************
- *** 15,23 ****
- X .\" - TPs use default indent except for function names, then 18.
- X .\" - Smallify uppercase strings.
- X .\" - Avoid passive voice and third person.
- ! .\" $Revision: 6.16 $
- X .\"
- ! .TH PNAME 1
- X .SH NAME
- X pname \- spreadsheet calculator
- X .SH SYNOPSIS
- --- 15,23 ----
- X .\" - TPs use default indent except for function names, then 18.
- X .\" - Smallify uppercase strings.
- X .\" - Avoid passive voice and third person.
- ! .\" $Revision: 6.17 $
- X .\"
- ! .TH PNAME\ #REVISION#\ 1
- X .SH NAME
- X pname \- spreadsheet calculator
- X .SH SYNOPSIS
- ***************
- *** 1161,1166 ****
- --- 1161,1176 ----
- X as long as they occur after the first three alpha characters.
- X .\" ----------
- X .TP
- + .B /l
- + Use this command to lock the current cell or a range of cells, i.e
- + make them immune to any type of editing. A locked cell can't be changed
- + in anyway until it is unlocked.
- + .TP
- + .B /U
- + This command is the opposite of the
- + .I /l
- + command and thus unlocks a locked cell and makes it editable.
- + .TP
- X .B /s
- X This command lists (shows) the currently defined range names.
- X If there are no defined range names, then a message is given,
- ***************
- *** 1866,1871 ****
- --- 1876,1892 ----
- X Be sure the table doesn't move unexpectedly!
- X .\" ----------
- X .TP 18
- + .BR @upper (e)
- + and
- + .BR @lower (e)
- + will case the string expression to upper or lower.
- + .\" ----------
- + .TP 18
- + .BR @capital (e)
- + will convert the first letter of words in a string
- + into upper case.
- + .\" ----------
- + .TP 18
- X .BR @ext (se,e)
- X Call an external function (program or script).
- X The purpose is to allow arbitrary functions on values,
- ***************
- *** 2094,2101 ****
- X .IR sc ,
- X and further modified by numerous contributors,
- X Jeff Buhrt
- ! of Grauel Enterprises, Inc.
- ! ({pur-phy (aka: gibbs.physics.purdue.edu), sequent}!sawmill!buhrt)
- X and Robert Bond of Sequent,
- X prominent among them.
- X Other contributors include:
- --- 2115,2122 ----
- X .IR sc ,
- X and further modified by numerous contributors,
- X Jeff Buhrt
- ! of Proslink, Inc.
- ! ({sequent, uunet}!sawmill!prslnk!buhrt)
- X and Robert Bond of Sequent,
- X prominent among them.
- X Other contributors include:
- ***************
- *** 2102,2112 ****
- --- 2123,2137 ----
- X Tom Anderson,
- X Glenn T. Barry,
- X Gregory Bond,
- + Stephen (Steve) M. Brooks,
- X Peter Brower,
- X John Campbell,
- X Lawrence Cipriani,
- X Jim Clausing,
- + Dave Close,
- X Chris Cole,
- + Jonathan Crompron
- + David I. Dalva,
- X Glen Ditchfield,
- X Sam Drake,
- X James P. Dugal,
- ***************
- *** 2114,2119 ****
- --- 2139,2145 ----
- X Andy Fyfe,
- X Jack Goral,
- X Piercarlo "Peter" Grandi,
- + Henk Hesselink
- X Jeffrey C Honig,
- X Kurt Horton,
- X Jonathan I. Kamens,
- ***************
- *** 2120,2136 ****
- X Peter King,
- X Tom Kloos,
- X Casey Leedom,
- X Dave Lewis,
- X Rick Linck,
- X Soren Lundsgaard,
- X Tad Mannes,
- X Rob McMahon,
- ! Chris Metcalf
- X Mark Nagel,
- ! Ulf Noren
- X Marius Olafsson,
- X Gene H. Olson,
- X Rick Perry,
- X Eric Putz,
- X Jim Richardson,
- X Michael Richardson,
- --- 2146,2165 ----
- X Peter King,
- X Tom Kloos,
- X Casey Leedom,
- + Jay Lepreau
- X Dave Lewis,
- X Rick Linck,
- X Soren Lundsgaard,
- X Tad Mannes,
- X Rob McMahon,
- ! Chris Metcalf,
- X Mark Nagel,
- ! Ulf Noren,
- X Marius Olafsson,
- X Gene H. Olson,
- + Henk P. Penning,
- X Rick Perry,
- + Larry Philps,
- X Eric Putz,
- X Jim Richardson,
- X Michael Richardson,
- ***************
- *** 2138,2146 ****
- --- 2167,2180 ----
- X Kim Sanders,
- X Mike Schwartz,
- X Alan Silverstein,
- + Lowell Skoog,
- + Herr Soeryantono,
- + Tim Theisen,
- X Tom Tkacik,
- X Andy Valencia,
- X Adri Verhoef,
- + Rick Walker,
- + Petri Wessman,
- X and
- X Tim Wilson.
- X .\" end of man page
- *** 6.16 1991/06/04 18:57:22
- --- psc.doc 1991/09/04 14:28:03
- ***************
- *** 1,5 ****
- X .\" $Revision $
- ! .TH PPNAME 1
- X .SH NAME
- X ppname \- prepare pname files
- X .SH SYNOPSIS
- --- 1,5 ----
- X .\" $Revision $
- ! .TH PPNAME\ #REVISION#\ 1
- X .SH NAME
- X ppname \- prepare pname files
- X .SH SYNOPSIS
- *** 6.16 1991/06/04 18:57:22
- --- tutorial.sc 1991/09/04 14:28:03
- ***************
- *** 1,96 ****
- X # This data file was generated by the Spreadsheet Calculator.
- X # You almost certainly shouldn't edit it.
- X
- ! define "page5" A89
- ! define "page1" A9
- ! define "page2" A29
- ! define "page3" A49
- ! define "page4" A70
- ! leftstring A1 = "This is a brief sc tutorial."
- ! leftstring A3 = "Cells are named by their column and row number. For example,"
- ! leftstring A4 = "Cell A4"
- ! leftstring B4 = "Cell B4"
- ! leftstring C4 = "Cell C4"
- ! leftstring A5 = "Cell A5"
- ! leftstring A6 = "Cell A6"
- ! leftstring C6 = "Cell C6"
- ! leftstring A7 = "Cells range from A0 to ZZ(some number depending on free memory)."
- ! leftstring A8 = "Cells can also be named by the user. See 'range names' in the manual."
- X leftstring page1 = "You can move the cursor a couple of different ways:"
- ! leftstring A11 = "^n, j and the <DOWN> arrow key go down"
- ! leftstring A12 = "^p, k and the <UP> arrow key go up"
- ! leftstring A13 = "^b, h and the <LEFT> arrow key go left"
- ! leftstring A14 = "^f, l and the <RIGHT> arrow key go right"
- ! leftstring A15 = "You can go directly to a cell by typing 'g' and the cell name. "
- ! leftstring A16 = "'g c6' will take you to cell c6."
- ! leftstring A18 = "Cells can contain numbers, formulas, or text."
- ! leftstring A19 = "Most of the cells on this page contain text."
- ! leftstring C20 = "<Type 'g page2' to continue>"
- ! leftstring A22 = "Cell d22 contains text"
- ! leftstring D22 = "Text "
- ! leftstring A23 = "Cell d23 contains a number"
- ! let D23 = 123.34
- ! leftstring A24 = "Cell d24 contains a formula"
- ! let D24 = D23+88
- ! leftstring A26 = "To see what the cell contains, just move the cursor"
- ! leftstring A27 = "onto the cell. The contents will show up on line 1 in the brackets."
- X leftstring page2 = "You can enter data into cells like this:"
- ! leftstring B30 = "'<text' enters left justified text."
- ! leftstring B31 = "'>text' enters right justified text."
- ! leftstring B32 = "'=number' enters a number"
- ! leftstring B33 = "'=formula' enters a formula."
- ! leftstring A35 = "Try duplicating d22 through d24 in e22 though e24."
- ! leftstring A37 = "You erase a cell by typing 'x' with the cursor on the cell."
- ! leftstring C40 = "<Type 'g page3' to continue>"
- ! leftstring A42 = "Here is a typical use for numbers and formulas:"
- ! let A44 = 10.3
- ! let B44 = 1877.5
- ! let C44 = 234.7
- ! let E44 = @sum(A44:C44)
- ! let A45 = 44.56
- ! let B45 = 44.3
- ! let C45 = -3
- X let E45 = @sum(A45:C45)
- ! let A46 = 88.74
- ! let B46 = 8000
- ! let C46 = -9
- X let E46 = @sum(A46:C46)
- ! let A47 = 99.2
- ! let B47 = -88
- ! let C47 = -44.6
- X let E47 = @sum(A47:C47)
- ! let page3 = @sum(A44:A47)
- ! let B49 = @sum(B44:B47)
- ! let C49 = @sum(C44:C47)
- ! let E49 = @sum(A44:C47)
- ! leftstring A51 = "The data is entered in a44 through c47."
- ! leftstring A52 = "Cells a49, b49 and c49 sum their respective columns."
- ! leftstring A53 = "Cells e44, e45, e46, and e47 sum their respective rows."
- ! leftstring A54 = "Cell E49 is a grand total."
- ! leftstring A55 = "Try changing some of the data cells and watch the sums change."
- ! leftstring A57 = "You can also edit cells by putting the cursor on the cell and typing:"
- ! leftstring B58 = "'e' to edit the numeric portion."
- ! leftstring B59 = "'E' to edit the string portion."
- ! leftstring C60 = "<Type 'g page4' to continue>"
- ! leftstring A62 = "Since you are reading this, you know that you can load "
- ! leftstring A63 = "a data base from a file by typing the file name as an"
- ! leftstring A64 = "argument to the program. You can also load or save a "
- ! leftstring A65 = "data base using the file commands:"
- ! leftstring B67 = "'G file'"
- ! leftstring C67 = "Gets the data from an sc file."
- ! leftstring B68 = "'P file'"
- ! leftstring C68 = "Puts the data from the spreadsheet into a file."
- X leftstring page4 = "Try 'P foo.sc' to write this to the file foo.sc"
- ! leftstring A71 = "The Get command erases the current spreadsheet. "
- ! leftstring A72 = "To merge a spreadsheet with the one currently in"
- ! leftstring A73 = "the machine, use:"
- ! leftstring B75 = "'M file'"
- ! leftstring C75 = "Merge the data from a saved sc file."
- ! leftstring A77 = "You can also get human readable versions of the data"
- ! leftstring A78 = "by using the Write command:"
- ! leftstring C80 = "<Type 'g page5' to continue>"
- ! leftstring A82 = "Try 'W tut.txt' for a clear text version of the tutorial."
- ! leftstring A85 = "This is the end of the tutorial. We have explored"
- ! leftstring A86 = "The basic commands. Much more detail is available"
- ! leftstring A87 = "in the man page."
- ! leftstring D91 = "GOOD LUCK!"
- --- 1,99 ----
- X # This data file was generated by the Spreadsheet Calculator.
- X # You almost certainly shouldn't edit it.
- X
- ! define "page4" A71
- ! define "page3" A50
- ! define "page2" A30
- ! define "page1" A11
- ! define "page5" A90
- ! leftstring A1 = "This is a brief sc tutorial, best run in a 24-line window."
- ! leftstring A2 = "Type 'q' to exit, ^Z to suspend (w/ Job Control)."
- ! leftstring A3 = "^G interrupts a command."
- ! leftstring A5 = "Cells are named by their column and row number. For example,"
- ! leftstring A6 = "Cell A5"
- ! leftstring B6 = "Cell B5"
- ! leftstring C6 = "Cell C5"
- ! leftstring A7 = "Cell A6"
- ! leftstring A8 = "Cell A7"
- ! leftstring C8 = "Cell C7"
- ! leftstring A9 = "Cells range from A0 to ZZ(some number depending on free memory)."
- ! leftstring A10 = "Cells can also be named by the user. See 'range names' in the manual."
- X leftstring page1 = "You can move the cursor a couple of different ways:"
- ! leftstring B12 = "^n, j and the <DOWN> arrow key go down"
- ! leftstring B13 = "^p, k and the <UP> arrow key go up"
- ! leftstring B14 = "^b, h and the <LEFT> arrow key go left"
- ! leftstring B15 = "^f, l and the <RIGHT> arrow key go right"
- ! leftstring B16 = "You can go directly to a cell by typing 'g' and the cell name. "
- ! leftstring B17 = "'g c6' will take you to cell c6."
- ! leftstring A19 = "Cells can contain numbers, formulas, or text."
- ! leftstring A20 = "Most of the cells on this page contain text."
- ! leftstring C21 = "<Type 'g page2' to continue>"
- ! leftstring A23 = "Cell d22 contains text"
- ! leftstring D23 = "Text "
- ! leftstring A24 = "Cell d23 contains a number"
- ! let D24 = 123.34
- ! leftstring A25 = "Cell d24 contains a formula"
- ! let D25 = D24+88
- ! leftstring A27 = "To see what the cell contains, just move the cursor"
- ! leftstring A28 = "onto the cell. The contents will show up on line 1 in the brackets."
- X leftstring page2 = "You can enter data into cells like this:"
- ! leftstring B31 = "'<text' enters left justified text."
- ! leftstring B32 = "'>text' enters right justified text."
- ! leftstring B33 = "'=number' enters a number"
- ! leftstring B34 = "'=formula' enters a formula."
- ! leftstring A36 = "Try duplicating d22 through d24 in e22 though e24."
- ! leftstring A38 = "You erase a cell by typing 'x' with the cursor on the cell."
- ! leftstring C41 = "<Type 'g page3' to continue>"
- ! leftstring A43 = "Here is a typical use for numbers and formulas:"
- ! let A45 = 10.3
- ! let B45 = 1877.5
- ! let C45 = 234.7
- X let E45 = @sum(A45:C45)
- ! let A46 = 44.56
- ! let B46 = 44.3
- ! let C46 = -3
- X let E46 = @sum(A46:C46)
- ! let A47 = 88.74
- ! let B47 = 8000
- ! let C47 = -9
- X let E47 = @sum(A47:C47)
- ! let A48 = 99.2
- ! let B48 = -88
- ! let C48 = -44.6
- ! let E48 = @sum(A48:C48)
- ! let page3 = @sum(A45:A48)
- ! let B50 = @sum(B45:B48)
- ! let C50 = @sum(C45:C48)
- ! let E50 = @sum(A45:C48)
- ! leftstring A52 = "The data is entered in a44 through c47."
- ! leftstring A53 = "Cells a49, b49 and c49 sum their respective columns."
- ! leftstring A54 = "Cells e44, e45, e46, and e47 sum their respective rows."
- ! leftstring A55 = "Cell E49 is a grand total."
- ! leftstring A56 = "Try changing some of the data cells and watch the sums change."
- ! leftstring A58 = "You can also edit cells by putting the cursor on the cell and typing:"
- ! leftstring B59 = "'e' to edit the numeric portion."
- ! leftstring B60 = "'E' to edit the string portion."
- ! leftstring C61 = "<Type 'g page4' to continue>"
- ! leftstring A63 = "Since you are reading this, you know that you can load "
- ! leftstring A64 = "a data base from a file by typing the file name as an"
- ! leftstring A65 = "argument to the program. You can also load or save a "
- ! leftstring A66 = "data base using the file commands:"
- ! leftstring B68 = "'G file'"
- ! leftstring C68 = "Gets the data from an sc file."
- ! leftstring B69 = "'P file'"
- ! leftstring C69 = "Puts the data from the spreadsheet into a file."
- X leftstring page4 = "Try 'P foo.sc' to write this to the file foo.sc"
- ! leftstring A72 = "The Get command erases the current spreadsheet. "
- ! leftstring A73 = "To merge a spreadsheet with the one currently in"
- ! leftstring A74 = "the machine, use:"
- ! leftstring B76 = "'M file'"
- ! leftstring C76 = "Merge the data from a saved sc file."
- ! leftstring A78 = "You can also get human readable versions of the data"
- ! leftstring A79 = "by using the Write command:"
- ! leftstring C81 = "<Type 'g page5' to continue>"
- ! leftstring A83 = "Try 'W tut.txt' for a clear text version of the tutorial."
- ! leftstring A86 = "This is the end of the tutorial. We have explored"
- ! leftstring A87 = "The basic commands. Much more detail is available"
- ! leftstring A88 = "in the man page."
- ! leftstring page5 = "To quit this program, type 'q'."
- ! leftstring D92 = "GOOD LUCK!"
- *** 6.16 1991/06/04 19:01:32
- --- Makefile 1991/09/04 15:14:36
- ***************
- *** 1,9 ****
- ! # Makefile $Revision: 6.16 $
- X #
- X # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
- X # RE_COMP/REGCMP, and DFLT_PAGER. Most of the other things aren't
- X # normally changed (see the comments with each)
- X # 2) Select the proper machine/compiler/OS section of code
- X # 3) make install
- X # 4) If you have the command 'file' that uses /etc/magic add the line:
- X # 38 string Spreadsheet sc file
- --- 1,10 ----
- ! # Makefile $Revision: 6.17 $
- X #
- X # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
- X # RE_COMP/REGCMP, and DFLT_PAGER. Most of the other things aren't
- X # normally changed (see the comments with each)
- X # 2) Select the proper machine/compiler/OS section of code
- + # for MS-DOS look for the pattern 'MS-DOS'
- X # 3) make install
- X # 4) If you have the command 'file' that uses /etc/magic add the line:
- X # 38 string Spreadsheet sc file
- ***************
- *** 24,29 ****
- --- 25,31 ----
- X #MANEXT=1 # reno
- X MANDIR=/usr/man/manl
- X MANEXT=l
- + MANMODE=644
- X
- X # This is where the library file (tutorial) goes.
- X #LIBDIR=/usr/local/share/$(name) # reno
- ***************
- *** 87,93 ****
- --- 89,99 ----
- X SAVE=-DSAVENAME=\"$(NAME).SAVE\"
- X
- X # path to crypt
- + # most systems
- X CRYPT=-DCRYPT_PATH=\"/bin/crypt\"
- + # BSD
- + #CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
- + # other people?
- X #CRYPT=CRYPT_PATH=\"/usr/local/bin/crypt\"
- X
- X # flags for lint
- ***************
- *** 116,127 ****
- X IDLOKBAD=-DIDLOKBAD
- X #IDLOKBAD=
- X
- ! # IF you have problems w/ your yacc and don't have, say, bison...
- ! # look just below for '### YACC PROBLEMS ###' and reverse the define to
- ! # use the included, pre-yacc'd copy. First try below.
- X #YACC=yacc
- X YACC=bison -y
- X
- X #### SYSTEM DEFINES ####
- X
- X # Use this for system AIX V3.1
- --- 122,138 ----
- X IDLOKBAD=-DIDLOKBAD
- X #IDLOKBAD=
- X
- ! # IF you have problems w/ your yacc try bison, Berkeley yacc, or
- ! # some other yacc. Some systems don't allow you to
- ! # increase the number of terminals (mostly AT&T), SCO's does though.
- X #YACC=yacc
- X YACC=bison -y
- X
- + # Command to use to make temporary copies of some source files.
- + LN=ln
- + #LN=ln -s
- + #LN=cp
- +
- X #### SYSTEM DEFINES ####
- X
- X # Use this for system AIX V3.1
- ***************
- *** 129,135 ****
- X #LDFLAGS=
- X #LIB=-lm -lPW -lcurses
- X
- ! # Use this for system V.2
- X #CFLAGS= -O -DSYSV2
- X #LDFLAGS=
- X #LIB=-lm -lPW -lcurses
- --- 140,146 ----
- X #LDFLAGS=
- X #LIB=-lm -lPW -lcurses
- X
- ! # Use this for system V.2 (includes: HP-UX 7.05, UNIXPC)
- X #CFLAGS= -O -DSYSV2
- X #LDFLAGS=
- X #LIB=-lm -lPW -lcurses
- ***************
- *** 143,151 ****
- X LIB=-lm -lcurses -lPW
- X # with gcc also use:
- X #CC=gcc
- ! #CFLAGS= -DSYSV3 -O -pipe
- ! YACC=bison -y
- X
- X # Use this for system V.4
- X #CFLAGS= -DSYSV4 -DSYSV3 -O
- X #LDFLAGS= -s
- --- 154,163 ----
- X LIB=-lm -lcurses -lPW
- X # with gcc also use:
- X #CC=gcc
- ! #CFLAGS= -DSYSV3 -O -pipe -traditional
- ! #YACC=bison -y
- X
- +
- X # Use this for system V.4
- X #CFLAGS= -DSYSV4 -DSYSV3 -O
- X #LDFLAGS= -s
- ***************
- *** 227,232 ****
- --- 239,255 ----
- X #LIB=-lm -lcurses -lPW -lmalloc -lc_s
- X #YACC=yacc -Sm10000
- X
- + # Use this for MS-DOS, Microsoft C 5.1 and NDMAKE
- + #CC=cl
- + #CFLAGS= -AL -O -Fo$*.o
- + #LDFLAGS=/noi /st:0x4000
- + #LIB=lcurses
- + #YACC=bison -y
- + #
- + #.SUFFIXES : .o .c
- + #.c.o:
- + # $(CC) $(CFLAGS) -c $*.c
- +
- X # All of the source files
- X SRC=Makefile cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
- X lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
- ***************
- *** 237,243 ****
- X screen.o version.o vi.o vmtbl.o xmalloc.o
- X
- X # The documents in the Archive
- ! DOCS=README CHANGES sc.doc psc.doc tutorial.sc VMS_NOTES
- X
- X all: $(name) p$(name) $(name)qref
- X
- --- 260,266 ----
- X screen.o version.o vi.o vmtbl.o xmalloc.o
- X
- X # The documents in the Archive
- ! DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev
- X
- X all: $(name) p$(name) $(name)qref
- X
- ***************
- *** 244,278 ****
- X $(name):$(PAR) $(OBJS)
- X $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
- X
- ! ### YACC PROBLEMS ###
- ! # IF you have problems w/ your yacc and don't have, say, bison...
- ! # for systems that don't allow you to increase the number of terminals
- ! # (mostly AT&T) (this will include a Berkeley yacc built gram.c and
- ! # y.tab.h) use:
- ! #gram.c: mygram.c
- ! # cp mygram.c gram.c
- ! #y.tab.h:
- ! # cp myy.tab.h y.tab.h
- ! #
- ! # Otherwise (most systems)
- X gram.c: gram.y
- X $(YACC) -d gram.y; mv y.tab.c gram.c
- X y.tab.h: gram.y
- X
- X
- X p$(name): psc.c pvmtbl.o pxmalloc.o
- ! $(CC) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
- X
- X qhelp.c: help.c
- X -rm -f qhelp.c
- ! ln help.c qhelp.c
- X
- ! $(name)qref: qhelp.c
- ! $(CC) $(LDFLAGS) -DQREF -DSCNAME=\"$(name)\" -o $(name)qref qhelp.c
- X
- X pvmtbl.c: vmtbl.c
- X -rm -f pvmtbl.c
- ! ln vmtbl.c pvmtbl.c
- X
- X pvmtbl.o: sc.h pvmtbl.c
- X $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
- --- 267,301 ----
- X $(name):$(PAR) $(OBJS)
- X $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
- X
- ! # Alternative for MS-DOS
- ! #$(name): $(OBJS)
- ! # link ${LDFLAGS} ${OBJS},$(name),,${LIB};
- !
- X gram.c: gram.y
- X $(YACC) -d gram.y; mv y.tab.c gram.c
- +
- X y.tab.h: gram.y
- X
- + # Alternative for MS-DOS
- + #gram.c: gram.y
- + # $(YACC) -d gram.y
- + # mv y_tab.c gram.c
- + #
- + #y_tab.h: gram.y
- X
- X p$(name): psc.c pvmtbl.o pxmalloc.o
- ! $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
- X
- X qhelp.c: help.c
- X -rm -f qhelp.c
- ! ${LN} help.c qhelp.c
- X
- ! $(name)qref: qhelp.c sc.h
- ! $(CC) $(CFLAGS) $(LDFLAGS) -DQREF -DSCNAME=\"$(name)\" -o $(name)qref qhelp.c
- X
- X pvmtbl.c: vmtbl.c
- X -rm -f pvmtbl.c
- ! ${LN} vmtbl.c pvmtbl.c
- X
- X pvmtbl.o: sc.h pvmtbl.c
- X $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
- ***************
- *** 279,324 ****
- X
- X pxmalloc.c: xmalloc.c
- X -rm -f pxmalloc.c
- ! ln xmalloc.c pxmalloc.c
- X
- ! pxmalloc.o: sc.h pxmalloc.c
- ! $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
- X
- ! lex.o: sc.h y.tab.h gram.o lex.c
- ! $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} -c lex.c
- X
- ! sc.o: sc.h sc.c
- ! $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
- X
- ! screen.o: sc.h screen.c
- ! $(CC) ${CFLAGS} ${BROKENCURSES} ${INTERNATIONAL} ${SIGVOID} -c screen.c
- X
- X interp.o: interp.c sc.h
- X $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} -c interp.c
- X
- ! gram.o: sc.h y.tab.h
- X
- ! cmds.o: cmds.c sc.h
- ! $(CC) ${CFLAGS} ${DOBACKUPS} -c cmds.c
- X
- ! crypt.o: crypt.c sc.h
- ! $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
- X
- X range.o: range.c sc.h
- X
- ! help.o: help.c sc.h
- X
- ! format.o: format.c
- X
- X vi.o: vi.c sc.h
- X
- ! gram.o: sc.h y.tab.h gram.c
- ! $(CC) ${CFLAGS} -c gram.c
- ! sed<gram.y >experres.h -f eres.sed;sed < gram.y > statres.h -f sres.sed
- X
- X clean:
- X rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \
- ! $(name).man p$(name).man p$(name).1 y.output $(name)qref
- X
- X shar: ${SRC} ${DOCS}
- X shar -c -m 64000 -f shar ${DOCS} ${SRC}
- --- 302,351 ----
- X
- X pxmalloc.c: xmalloc.c
- X -rm -f pxmalloc.c
- ! ${LN} xmalloc.c pxmalloc.c
- X
- ! # Objects
- X
- ! cmds.o: cmds.c sc.h
- ! $(CC) ${CFLAGS} ${DOBACKUPS} -c cmds.c
- X
- ! crypt.o: crypt.c sc.h
- ! $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
- X
- ! format.o: format.c
- X
- + help.o: help.c sc.h
- +
- X interp.o: interp.c sc.h
- X $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} -c interp.c
- X
- ! gram.o: sc.h y.tab.h gram.c
- ! $(CC) ${CFLAGS} -c gram.c
- ! sed < gram.y > experres.h -f eres.sed
- ! sed < gram.y > statres.h -f sres.sed
- X
- ! lex.o: sc.h y.tab.h gram.o lex.c
- ! $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} -c lex.c
- X
- ! pxmalloc.o: sc.h pxmalloc.c
- ! $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
- X
- X range.o: range.c sc.h
- X
- ! sc.o: sc.h sc.c
- ! $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
- X
- ! screen.o: sc.h screen.c
- ! $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKBAD} ${INTERNATIONAL} ${SIGVOID} -c screen.c
- X
- X vi.o: vi.c sc.h
- X
- ! # other stuff
- X
- X clean:
- X rm -f *.o *res.h y.tab.h $(name) p$(name) debug core gram.c $(name).1 \
- ! $(name).man p$(name).man p$(name).1 y.output $(name)qref \
- ! pxmalloc.c pvmtbl.c qhelp.c y_tab.h
- X
- X shar: ${SRC} ${DOCS}
- X shar -c -m 64000 -f shar ${DOCS} ${SRC}
- ***************
- *** 347,354 ****
- X prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
- X
- X $(name).1: sc.doc
- ! sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
- ! -e s%#LIBDIR#%$(LIBDIR)%g sc.doc > $(name).1
- X
- X $(name).man: $(name).1
- X nroff -man $(name).1 > $(name).man
- --- 374,386 ----
- X prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
- X
- X $(name).1: sc.doc
- ! name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc > $(name).1
- ! # sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
- ! # -e s%#LIBDIR#%$(LIBDIR)%g sc.doc > $(name).1
- ! # REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.17 $(
- ! # sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
- ! # -e s%#LIBDIR#%$(LIBDIR)%g \
- ! # -e 's/#REVISION#/$(REVISION)/' sc.doc > $(name).1
- X
- X $(name).man: $(name).1
- X nroff -man $(name).1 > $(name).man
- ***************
- *** 357,369 ****
- X itpf -x -Pim2 -man $(name).1
- X
- X p$(name).1: psc.doc
- ! sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc > p$(name).1
- X
- X p$(name).man: p$(name).1
- X nroff -man p$(name).1 > p$(name).man
- X
- X install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
- ! $(LIBDIR)/tutorial $(MANDIR)/$(name).$(MANEXT)
- X
- X $(EXDIR)/$(name): $(name)
- X cp $(name) $(EXDIR)
- --- 389,403 ----
- X itpf -x -Pim2 -man $(name).1
- X
- X p$(name).1: psc.doc
- ! name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
- ! # sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc > p$(name).1
- X
- X p$(name).man: p$(name).1
- X nroff -man p$(name).1 > p$(name).man
- X
- X install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
- ! $(LIBDIR)/tutorial \
- ! $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
- X
- X $(EXDIR)/$(name): $(name)
- X cp $(name) $(EXDIR)
- ***************
- *** 379,384 ****
- --- 413,419 ----
- X
- X $(LIBDIR)/tutorial: tutorial.sc $(LIBDIR)
- X cp tutorial.sc $(LIBDIR)/tutorial.$(name)
- + chmod $(MANMODE) $(LIBDIR)/tutorial.$(name)
- X
- X $(LIBDIR):
- X mkdir $(LIBDIR)
- ***************
- *** 385,395 ****
- X
- X $(MANDIR)/$(name).$(MANEXT): $(name).1
- X cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
- X
- X diffs: ${SRC}
- ! for i in ${SRC} ${DOCS} ;\
- X do \
- ! rcsdiff -c -r6.11 $$i ;\
- X done
- X
- X # THA 10/14/90 Added code to make a patchfile
- --- 420,435 ----
- X
- X $(MANDIR)/$(name).$(MANEXT): $(name).1
- X cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
- + chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
- +
- + $(MANDIR)/p$(name).$(MANEXT): p$(name).1
- + cp p$(name).1 $(MANDIR)/p$(name).$(MANEXT)
- + chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
- X
- X diffs: ${SRC}
- ! for i in ${DOCS} ${SRC} ;\
- X do \
- ! rcsdiff -c -r6.16 $$i ;\
- X done
- X
- X # THA 10/14/90 Added code to make a patchfile
- ***************
- *** 399,401 ****
- --- 439,444 ----
- X do \
- X diffc $$i /users/toma/sc/sc6.12/$$i >> patchfile ;\
- X done
- +
- + files:
- + @find $(DOCS) $(SRC) -print
- *** 6.16 1991/06/04 18:57:22
- --- cmds.c 1991/09/04 14:28:06
- ***************
- *** 7,13 ****
- X *
- X * More mods Robert Bond, 12/86
- X *
- ! * $Revision: 6.16 $
- X */
- X
- X #include <sys/types.h>
- --- 7,13 ----
- X *
- X * More mods Robert Bond, 12/86
- X *
- ! * $Revision: 6.17 $
- X */
- X
- X #include <sys/types.h>
- ***************
- *** 118,128 ****
- X deleterow(arg)
- X register int arg;
- X {
- ! flush_saved();
- ! erase_area(currow, 0, currow + arg - 1, maxcol);
- ! currow += arg;
- ! while (--arg>=0) closerow (--currow);
- ! sync_refs();
- X }
- X
- X void
- --- 118,132 ----
- X deleterow(arg)
- X register int arg;
- X {
- ! if (any_locked_cells(currow, 0, currow + arg - 1, maxcol))
- ! error("Locked cells encountered. Nothing changed");
- ! else {
- ! flush_saved();
- ! erase_area(currow, 0, currow + arg - 1, maxcol);
- ! currow += arg;
- ! while (--arg>=0) closerow (--currow);
- ! sync_refs();
- ! }
- X }
- X
- X void
- ***************
- *** 149,155 ****
- X for (r = sr; r <= er; r++) {
- X for (c = sc; c <= ec; c++) {
- X pp = ATBL(tbl, r, c);
- ! if (*pp) {
- X free_ent(*pp);
- X *pp = (struct ent *)0;
- X }
- --- 153,159 ----
- X for (r = sr; r <= er; r++) {
- X for (c = sc; c <= ec; c++) {
- X pp = ATBL(tbl, r, c);
- ! if (*pp && !((*pp)->flags&is_locked)) {
- X free_ent(*pp);
- X *pp = (struct ent *)0;
- X }
- ***************
- *** 185,190 ****
- --- 189,198 ----
- X for (r = sr; r <= er; r++) {
- X for (c = sc; c <= ec; c++) {
- X p = *ATBL(tbl, r, c);
- + if (p->flags&is_locked) {
- + error(" Cell %s%d is locked", coltoa(c), r);
- + continue;
- + }
- X if (p && p->expr) {
- X efree(p->expr);
- X p->expr = (struct enode *)0;
- ***************
- *** 470,475 ****
- --- 478,487 ----
- X error(buf);
- X return;
- X }
- + if (any_locked_cells(0, curcol, maxrow, curcol + numcol - 1)) {
- + error("Locked cells encountered. Nothing changed");
- + return;
- + }
- X flush_saved();
- X erase_area(0, curcol, maxrow, curcol + numcol - 1);
- X sync_refs();
- ***************
- *** 619,625 ****
- X }
- X
- X for(i = c1; i<=c2; i++)
- ! fwidth[i] = w, precision[i] = p, realfmt[i] = r;
- X
- X FullUpdate++;
- X modflg++;
- --- 631,637 ----
- X }
- X
- X for(i = c1; i<=c2; i++)
- ! fwidth[i] = w, precision[i] = p, realfmt[i] = r;
- X
- X FullUpdate++;
- X modflg++;
- ***************
- *** 1173,1178 ****
- --- 1185,1194 ----
- X return(fopen(efname, "w"));
- X }
- X
- + #if defined(MSDOS)
- + error("Piping not available under MS-DOS\n");
- + return(0);
- + #else
- X fname++; /* Skip | */
- X if ( pipe (pipefd) < 0) {
- X error("Can't make pipe to child");
- ***************
- *** 1208,1213 ****
- --- 1224,1230 ----
- X }
- X #endif /* VMS */
- X return(f);
- + #endif /* MSDOS */
- X }
- X
- X /* close a file opened by openout(), if process wait for return */
- ***************
- *** 1219,1224 ****
- --- 1236,1242 ----
- X int temp;
- X
- X (void) fclose (f);
- + #if !defined(MSDOS)
- X if (pid) {
- X while (pid != wait(&temp)) /**/;
- X (void) printf("Press RETURN to continue ");
- ***************
- *** 1226,1231 ****
- --- 1244,1250 ----
- X (void) nmgetch();
- X goraw();
- X }
- + #endif /* MSDOS */
- X }
- X
- X void
- ***************
- *** 1295,1300 ****
- --- 1314,1322 ----
- X editfmt (r, c);
- X (void) fprintf (f, "%s\n",line);
- X }
- + if ((*pp)->flags&is_locked)
- + (void) fprintf(f, "lock %s%d\n", coltoa((*pp)->col),
- + (*pp)->row) ;
- X }
- X }
- X if (rndinfinity)
- ***************
- *** 1310,1316 ****
- X char save[PATHLEN];
- X int pid;
- X
- ! #ifndef VMS
- X if (Crypt) {
- X return (cwritefile(fname, r0, c0, rn, cn));
- X }
- --- 1332,1338 ----
- X char save[PATHLEN];
- X int pid;
- X
- ! #if !defined(VMS) && !defined(MSDOS)
- X if (Crypt) {
- X return (cwritefile(fname, r0, c0, rn, cn));
- X }
- ***************
- *** 1360,1366 ****
- X (void) strcpy(save,fname);
- X }
- X
- ! #ifndef VMS
- X if (Crypt) {
- X creadfile(save, eraseflg);
- X return;
- --- 1382,1388 ----
- X (void) strcpy(save,fname);
- X }
- X
- ! #if !defined(VMS) && !defined(MSDOS)
- X if (Crypt) {
- X creadfile(save, eraseflg);
- X return;
- ***************
- *** 1559,1564 ****
- --- 1581,1587 ----
- X if (e == (struct enode *)0)
- X return NUM;
- X switch (e->op) {
- + case UPPER: case LOWER: case CAPITAL:
- X case O_SCONST: case '#': case DATE: case FMT: case STINDEX:
- X case EXT: case SVAL: case SUBSTR:
- X return (STR);
- ***************
- *** 1610,1616 ****
- --- 1633,1641 ----
- X }
- X
- X /* expand a ~ in a path to your home directory */
- + #if !defined(MSDOS)
- X #include <pwd.h>
- + #endif
- X char *
- X findhome(path)
- X char *path;
- ***************
- *** 1631,1636 ****
- --- 1656,1662 ----
- X if ((*pathptr == '/') || (*pathptr == '\0'))
- X { strcpy(tmppath, HomeDir);
- X }
- + #if !defined(MSDOS)
- X else
- X { struct passwd *pwent;
- X extern struct passwd *getpwnam();
- ***************
- *** 1647,1653 ****
- X }
- X strcpy(tmppath, pwent->pw_dir);
- X }
- !
- X strcat(tmppath, pathptr);
- X strcpy(path, tmppath);
- X }
- --- 1673,1679 ----
- X }
- X strcpy(tmppath, pwent->pw_dir);
- X }
- ! #endif
- X strcat(tmppath, pathptr);
- X strcpy(path, tmppath);
- X }
- *** 6.16 1991/06/04 18:57:22
- --- crypt.c 1991/09/04 14:28:07
- ***************
- *** 2,8 ****
- X * Encryption utilites
- X * Bradley Williams
- X * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
- ! * $Revision: 6.16 $
- X */
- X
- X #include <stdio.h>
- --- 2,8 ----
- X * Encryption utilites
- X * Bradley Williams
- X * {allegra,ihnp4,uiucdcs,ctvax}!convex!williams
- ! * $Revision: 6.17 $
- X */
- X
- X #include <stdio.h>
- ***************
- *** 66,72 ****
- X (void) dup (pipefd[1]); /* connect to pipe */
- X (void) fprintf (stderr, " ");
- X (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
- !
- X exit (-127);
- X }
- X else /* else parent */
- --- 66,73 ----
- X (void) dup (pipefd[1]); /* connect to pipe */
- X (void) fprintf (stderr, " ");
- X (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
- ! (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in creadfile() failed",
- ! CRYPT_PATH, KeyWord);
- X exit (-127);
- X }
- X else /* else parent */
- ***************
- *** 158,163 ****
- --- 159,166 ----
- X (void) dup (fildes); /* standard out to file */
- X (void) fprintf (stderr, " ");
- X (void) execl (CRYPT_PATH, "crypt", KeyWord, 0);
- + (void) fprintf (stderr, "execl(%s, \"crypt\", %s, 0) in cwritefile() failed",
- + CRYPT_PATH, KeyWord);
- X exit (-127);
- X }
- X else /* else parent */
- *** 6.16 1991/06/04 18:57:22
- --- format.c 1991/09/04 14:28:08
- ***************
- *** 3,9 ****
- X * Mark Nagel <nagel@ics.uci.edu>
- X * 20 July 1989
- X *
- ! * $Revision: 6.16 $
- X *
- X * bool
- X * format(fmt, num, buf, buflen)
- --- 3,9 ----
- X * Mark Nagel <nagel@ics.uci.edu>
- X * 20 July 1989
- X *
- ! * $Revision: 6.17 $
- X *
- X * bool
- X * format(fmt, num, buf, buflen)
- *** 6.16 1991/06/04 18:57:22
- --- gram.y 1991/09/04 14:28:09
- ***************
- *** 9,15 ****
- X *
- X * More mods by Alan Silverstein, 3/88, see list of changes.
- X *
- ! * $Revision: 6.16 $
- X */
- X
- X
- --- 9,15 ----
- X *
- X * More mods by Alan Silverstein, 3/88, see list of changes.
- X *
- ! * $Revision: 6.17 $
- X */
- X
- X
- ***************
- *** 60,65 ****
- --- 60,67 ----
- X %token S_SHOW
- X %token S_ERASE
- X %token S_FILL
- + %token S_LOCK
- + %token S_UNLOCK
- X %token S_GOTO
- X %token S_DEFINE
- X %token S_UNDEFINE
- ***************
- *** 118,123 ****
- --- 120,128 ----
- X %token K_TTS
- X %token K_FMT
- X %token K_SUBSTR
- + %token K_UPPER
- + %token K_LOWER
- + %token K_CAPITAL
- X %token K_STON
- X %token K_EQS
- X %token K_EXT
- ***************
- *** 236,241 ****
- --- 241,256 ----
- X { fill($2.left.vp, $2.right.vp, $3, $4); }
- X | S_FMT var_or_range STRING
- X { format_cell($2.left.vp, $2.right.vp, $3); }
- + | S_LOCK
- + { lock_cells(lookat(showsr, showsc),
- + lookat(currow, curcol)); }
- + | S_LOCK var_or_range
- + { lock_cells($2.left.vp, $2.right.vp); }
- + | S_UNLOCK
- + { unlock_cells(lookat(showsr, showsc),
- + lookat(currow, curcol)); }
- + | S_UNLOCK var_or_range
- + { unlock_cells($2.left.vp, $2.right.vp); }
- X | S_GOTO var_or_range {moveto($2.left.vp->row, $2.left.vp->col);}
- X | S_GOTO num { num_search($2, 0); }
- X | S_GOTO errlist
- ***************
- *** 320,325 ****
- --- 335,343 ----
- X | '@' K_EQS '(' e ',' e ')' { $$ = new (EQS, $4, $6); }
- X | '@' K_DATE '(' e ')' { $$ = new(DATE, ENULL, $4); }
- X | '@' K_FMT '(' e ',' e ')' { $$ = new(FMT, $4, $6); }
- + | '@' K_UPPER '(' e ')' { $$ = new(UPPER, ENULL, $4); }
- + | '@' K_LOWER '(' e ')' { $$ = new(LOWER, ENULL, $4); }
- + | '@' K_CAPITAL '(' e ')' { $$ = new(CAPITAL, ENULL, $4); }
- X | '@' K_INDEX '(' e ',' var_or_range ')'
- X { $$ = new(INDEX, $4, new_range(REDUCE | INDEX, $6)); }
- X | '@' K_LOOKUP '(' e ',' var_or_range ')'
- ***************
- *** 343,348 ****
- --- 361,367 ----
- X | NUMBER { $$ = new_const(O_CONST, (double) $1); }
- X | FNUMBER { $$ = new_const(O_CONST, $1); }
- X | K_PI { $$ = new_const(O_CONST, (double)3.14159265358979323846); }
- + | '@' K_PI { $$ = new_const(O_CONST, (double)3.14159265358979323846); }
- X | STRING { $$ = new_str($1); }
- X | '~' term { $$ = new ('~', ENULL, $2); }
- X | '!' term { $$ = new ('~', ENULL, $2); }
- ***************
- *** 367,372 ****
- --- 386,392 ----
- X | e '|' e { $$ = new ('|', $1, $3); }
- X | e '<' '=' e { $$ = new ('~', ENULL, new ('>', $1, $4)); }
- X | e '!' '=' e { $$ = new ('~', ENULL, new ('=', $1, $4)); }
- + | e '<' '>' e { $$ = new ('~', ENULL, new ('=', $1, $4)); }
- X | e '>' '=' e { $$ = new ('~', ENULL, new ('<', $1, $4)); }
- X | e '#' e { $$ = new ('#', $1, $3); }
- X ;
- *** 6.16 1991/06/04 18:57:22
- --- help.c 1991/09/04 14:57:06
- ***************
- *** 2,13 ****
- X * Help functions for sc
- X * R. Bond, 1988
- X * J. Buhrt 1990
- ! * $Revision: 6.16 $
- X */
- X
- X #ifdef QREF
- X #include <stdio.h>
- ! char *header = " Quick Reference\n\n$Revision: 6.16 $";
- X #else
- X #include <curses.h>
- X #include "sc.h"
- --- 2,13 ----
- X * Help functions for sc
- X * R. Bond, 1988
- X * J. Buhrt 1990
- ! * $Revision: 6.17 $
- X */
- X
- X #ifdef QREF
- X #include <stdio.h>
- ! char *header = " Quick Reference\n\n$Revision: 6.17 $";
- X #else
- X #include <curses.h>
- X #include "sc.h"
- ***************
- *** 203,208 ****
- --- 203,210 ----
- X " /d Assign a name to a cell or a range of cells. Give the",
- X " the name, surrounded by quotes, and either a cell name such",
- X " as ``A10'' or a range such as ``a1:b20''.",
- + " /l Locks a cell or a range of cells, i.e makes it unchangeable.",
- + " /U Unlocks a locked cell, i.e makes it changeable.",
- X " /s Shows the currently defined range names. Pipe output to",
- X " sort, then to less.",
- X " /u Use this command to undefine a previously defined range name.",
- ***************
- *** 321,327 ****
- X char *stringf[] = {
- X " ",
- X " M: String functions:",
- - " ",
- X " # Concatenate strings. For example, the",
- X " string expression ``A0 # \"zy dog\"'' yields",
- X " ``the lazy dog'' if A0 is ``the la''.",
- --- 323,328 ----
- ***************
- *** 338,344 ****
- X " to the command line as an argument. @ext yields",
- X " a string: the first line printed to standard",
- X " output by the command.",
- ! " @coltoa(e) Return a column letter(s) from the passed number",
- X " String expressions are made up of constant strings (characters",
- X " surrounded by quotes), variables, and string functions.",
- X (char *)0
- --- 339,347 ----
- X " to the command line as an argument. @ext yields",
- X " a string: the first line printed to standard",
- X " output by the command.",
- ! " @coltoa(e) Return the column letter(s) from the passed number",
- ! " @upper(e) @lower(e) Return the string in upper/lower case",
- ! " @capital(e) Return the string with words in upper case",
- X " String expressions are made up of constant strings (characters",
- X " surrounded by quotes), variables, and string functions.",
- X (char *)0
- *** 6.16 1991/06/04 18:55:36
- --- interp.c 1991/09/04 14:28:13
- ***************
- *** 7,13 ****
- X *
- X * More mods Robert Bond, 12/86
- X * More mods by Alan Silverstein, 3-4/88, see list of changes.
- ! * $Revision: 6.16 $
- X */
- X
- X #define DEBUGDTS 1 /* REMOVE ME */
- --- 7,13 ----
- X *
- X * More mods Robert Bond, 12/86
- X * More mods by Alan Silverstein, 3-4/88, see list of changes.
- ! * $Revision: 6.17 $
- X */
- X
- X #define DEBUGDTS 1 /* REMOVE ME */
- ***************
- *** 25,30 ****
- --- 25,31 ----
- X #include <signal.h>
- X #include <setjmp.h>
- X #include <stdio.h>
- + #include <ctype.h>
- X
- X extern int errno; /* set by math functions */
- X #ifdef BSD42
- ***************
- *** 740,746 ****
- X num = eval(e->e.o.left);
- X denom = eval(e->e.o.right);
- X if (denom)
- ! /* if (1)*/
- X return(num/denom);
- X else
- X { cellerror = CELLERROR;
- --- 741,747 ----
- X num = eval(e->e.o.left);
- X denom = eval(e->e.o.right);
- X if (denom)
- ! /* if (1) /* to test num div 0 */
- X return(num/denom);
- X else
- X { cellerror = CELLERROR;
- ***************
- *** 1022,1028 ****
- X * written to files, etc.
- X */
- X
- ! #ifdef VMS
- X char *
- X doext(command, value)
- X char *command;
- --- 1023,1029 ----
- X * written to files, etc.
- X */
- X
- ! #if defined(VMS) || defined(MSDOS)
- X char *
- X doext(command, value)
- X char *command;
- ***************
- *** 1029,1035 ****
- X double value;
- X {
- X error("Warning: External functions unavailable on VMS");
- ! cellerror = CELLERROR /* not sure if this should be a cellerror */
- X if (command)
- X xfree(command);
- X return (strcpy (xmalloc((unsigned) 1), "\0"));
- --- 1030,1036 ----
- X double value;
- X {
- X error("Warning: External functions unavailable on VMS");
- ! cellerror = CELLERROR; /* not sure if this should be a cellerror */
- X if (command)
- X xfree(command);
- X return (strcpy (xmalloc((unsigned) 1), "\0"));
- ***************
- *** 1157,1162 ****
- --- 1158,1223 ----
- X return(p);
- X }
- X
- + /*
- + * character casing: make upper case, make lower case
- + */
- +
- + char *
- + docase( acase, s)
- + int acase;
- + char *s;
- + {
- + char *p = s;
- +
- + if (s == NULL)
- + return(NULL);
- +
- + if( acase == UPPER ) {
- + while( *p != '\0' ) {
- + if( islower(*p) )
- + *p = toupper(*p);
- + p++;
- + }
- + }
- + else if ( acase == LOWER ) {
- + while( *p != '\0' ) {
- + if (isupper(*p))
- + *p = tolower(*p);
- + p++;
- + }
- + }
- + return (s);
- + }
- +
- + /*
- + * make proper capitals of every word in a string
- + */
- +
- + char *
- + docapital( s )
- + char *s;
- + {
- + char *p;
- + int skip = 1;
- +
- + if (s == NULL)
- + return(NULL);
- + for (p = s; *p != '\0'; p++) {
- + if (!isalnum(*p))
- + skip = 1;
- + else
- + if (skip == 1) {
- + skip = 0;
- + if (islower(*p))
- + *p = toupper(*p);
- + }
- + else /* if the string was all upper before */
- + if (isupper(*p))
- + *p = tolower(*p);
- + }
- + return(s);
- + }
- +
- X char *
- X seval(se)
- X register struct enode *se;
- ***************
- *** 1185,1190 ****
- --- 1246,1254 ----
- X : seval(se->e.o.right->e.o.right));
- X case DATE: return(dodate((long)(eval(se->e.o.right))));
- X case FMT: return(dofmt(seval(se->e.o.left), eval(se->e.o.right)));
- + case UPPER: return(docase(UPPER, seval(se->e.o.right)));
- + case LOWER: return(docase(LOWER, seval(se->e.o.right)));
- + case CAPITAL:return(docapital(seval(se->e.o.right)));
- X case STINDEX:
- X { register r,c;
- X register maxr, maxc;
- ***************
- *** 1207,1213 ****
- X default:
- X error ("Illegal string expression");
- X exprerr = 1;
- ! return((char *)0);
- X }
- X }
- X
- --- 1271,1277 ----
- X default:
- X error ("Illegal string expression");
- X exprerr = 1;
- ! return(NULL);
- X }
- X }
- X
- ***************
- *** 1261,1272 ****
- X if(calc_order == BYROWS ) {
- X for (i=0; i<=maxrow; i++)
- X for (j=0; j<=maxcol; j++)
- ! if ((p = *ATBL(tbl,i,j)) && p->expr) RealEvalOne(p,i,j,&chgct);
- X }
- X else if ( calc_order == BYCOLS ) {
- X for (j=0; j<=maxcol; j++)
- X { for (i=0; i<=maxrow; i++)
- ! if ((p = *ATBL(tbl,i,j)) && p->expr) RealEvalOne(p,i,j,&chgct);
- X }
- X }
- X else error("Internal error calc_order");
- --- 1325,1336 ----
- X if(calc_order == BYROWS ) {
- X for (i=0; i<=maxrow; i++)
- X for (j=0; j<=maxcol; j++)
- ! if ((p = *ATBL(tbl,i,j)) && !(p->flags&is_locked) && p->expr) RealEvalOne(p,i,j,&chgct);
- X }
- X else if ( calc_order == BYCOLS ) {
- X for (j=0; j<=maxcol; j++)
- X { for (i=0; i<=maxrow; i++)
- ! if ((p = *ATBL(tbl,i,j)) && !(p->flags&is_locked) && p->expr) RealEvalOne(p,i,j,&chgct);
- X }
- X }
- X else error("Internal error calc_order");
- ***************
- *** 1308,1315 ****
- X v = (double)0.0;
- X } else {
- X cellerror = CELLOK;
- - v = eval (p->expr);
- X gmyrow=i; gmycol=j;
- SHAR_EOF
- true || echo 'restore of pch616-617 failed'
- fi
- echo 'End of part 1'
- echo 'File pch616-617 is continued in part 2'
- echo 2 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-